<template>
  <el-card class="top">
    <div class="left">
      <b class="font20">社团管理</b>
    </div>

    <div class="right">
      <el-form class="myform" :model="searchForm">
        <el-form-item label="社团名称">
          <el-input v-model="searchForm.organizationName"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button class="reset-btn" @click="handleReset">重置</el-button>
          <el-button type="primary" @click="handleSearch">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
  </el-card>
</template>

<script lang="ts" setup>
import { reactive } from "vue";

const props = defineProps(["title", "searchForm"]);
const emits = defineEmits(["search"]);

const handleReset = function () {
  for (const item in props.searchForm) {
    props.searchForm[item] = "";
  }
};

const handleSearch = () => {
  emits("search");
};
</script>

<style lang="less" scoped>
.top {

  :deep(.el-card__body) {
    display: flex;
    justify-content: space-between;
  }

  .left,
  .right {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .right {
    display: flex;

    .myform {
      display: flex;

      .reset-btn {
        margin-left: 20px;
      }
    }
  }
}

:deep(.el-form-item) {
  margin-bottom: 0;
}
</style>
